# coding: utf-8
class UserMailer < ActionMailer::Base
  default from: "support@ttbiji.com"

  # Subject can be set in your I18n file at config/locales/en.yml
  # with the following lookup:
  #
  #   en.user_mailer.reply.subject
  #
  def reply(name, email, reply)
    @greeting = name
    @reply = reply
    mail(:to => email, :subject => "来自天天笔记的反馈回复")
  end

  # 注册成功后发邮件
  def reg(email, uid, name, pass)
    if(email != nil and (email.include? '@'))
      @name = name
      @pass = pass
      @email_valid_url = UserBll.getEmailCertUrl(uid, email)
      mail(:to => email, :subject => "天天笔记注册成功")
    end
  end

  # 通过认证邮箱找回密码
  def resetpass(email, name, url)
    if(email != nil and (email.include? '@'))
      @name = name
      @url = url
      mail(:to => email, :subject => "天天笔记重置密码")
    end
  end

end
